package com.es.www.kyl.bean.req.web;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author Estranger
 * @date 2025/7/31
 * description
 */
@Data
public class QuestionAddReq implements Serializable {
	private static final long serialVersionUID = 203498429859924297L;

	@ApiModelProperty(value = "一级分类id")
	@NotNull(message = "分类id不能为空")
	private Integer categoryId;

	@ApiModelProperty(value = "题目名称")
	@NotNull(message = "题目名称不能为空")
	private String title;

	@ApiModelProperty(value = "题目视频")
	private List<String> videoList;

	@ApiModelProperty(value = "题目图片")
	private List<String> imageList;

	@ApiModelProperty(value = "题目类型 1.单选; 2.多选; 3.填空; 4.判断")
	private String type;

	@ApiModelProperty(value = "状态 0: 待审核；1: 已发布；-1: 已驳回")
	private Integer status;

	@ApiModelProperty(value = "题目选项")
	@Valid
	@NotEmpty(message = "必须至少提供一个选项或答案")
	private List<QuestionOptionReq> optionList;

	@ApiModelProperty(value = "题目解析")
	private List<QuestionAnalysisReq> analysisList;

	@Data
	public static class QuestionOptionReq implements Serializable {

		private static final long serialVersionUID = 5622523650655362016L;

		@ApiModelProperty(value = "选项内容")
		private String optionContent;

		@ApiModelProperty(value = "是否正确")
		private Boolean correctFlag;

		@ApiModelProperty(value = "排序")
		private Integer sort;
	}

	@Data
	public static class QuestionAnalysisReq implements Serializable {

		private static final long serialVersionUID = -667736118646328755L;

		@ApiModelProperty(value = "解析类型 1: text；2:image; 3:video")
		private String type;

		@ApiModelProperty(value = "解析内容")
		private String content;

		@ApiModelProperty(value = "排序")
		private Integer sort;
	}
}
